/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.infor.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.service.TreeService;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.infor.entity.District;
import com.jeeplus.modules.infor.mapper.DistrictMapper;

/**
 * 区域Service
 * @author sld
 * @version 2017-11-23
 */
@Service
@Transactional(readOnly = true)
public class DistrictService extends TreeService<DistrictMapper, District> {

	public District get(String id) {
		return super.get(id);
	}
	
	public List<District> findList(District district) {
		if (StringUtils.isNotBlank(district.getParentIds())){
			district.setParentIds(","+district.getParentIds()+",");
		}
		return super.findList(district);
	}
	
	@Transactional(readOnly = false)
	public void save(District district) {
		super.save(district);
	}
	
	@Transactional(readOnly = false)
	public void delete(District district) {
		super.delete(district);
	}
	
}